import service from '@/utils/request'

export function CFTCApi() {
  const fn = {
    getPage(params) {
      return service({
          url: '/CriteriaAPIStructure/selectInstitutionCftcs',
          method: 'get',
          params
      })
    },
    del(id) {
      return service({
          url: '/CriteriaAPIStructure/deleteInstitutionCftcsById/'+id,
          method: 'delete',
      })
    },
    selectAllVariety(id) {
      return service({
          url: '/CriteriaAPIStructure/selectAllVariety',
          method: 'get',
      })
    },
    add(data) {
      return service({
          url: '/CriteriaAPIStructure/insertInstitutionCftcs',
          method: 'post',
          data
      })
    },
    edit(data) {
      return service({
          url: '/CriteriaAPIStructure/updateInstitutionCftcs',
          method: 'put',
          data
      })
    }
  }
  return fn;

}

export function ETFSApi() {
  const fn = {
    getPage(params) {
      return service({
          url: '/CriteriaAPIStructure/selectInstitutionETFs',
          method: 'get',
          params
      })
    },
    del(id) {
      return service({
          url: '/CriteriaAPIStructure/deleteInstitutionETFsById/'+id,
          method: 'delete',
      })
    },
    // selectAllVariety(id) {
    //   return service({
    //       url: '/CriteriaAPIStructure/selectAllVariety',
    //       method: 'get',
    //   })
    // },
    add(data) {
      return service({
          url: '/CriteriaAPIStructure/insertInstitutionETFs',
          method: 'post',
          data
      })
    },
    edit(data) {
      return service({
          url: '/CriteriaAPIStructure/updateInstitutionETFs',
          method: 'put',
          data
      })
    }
  }
  return fn;

}

// 库存
export function LME_INVENTORYApi() {
  const fn = {
    getPage(params) {
      return service({
          url: '/CriteriaAPIStructure/selectInstitutionLmeInventory',
          method: 'get',
          params
      })
    },
    del(id) {
      return service({
          url: '/CriteriaAPIStructure/deleteInstitutionLmeInventoryById/'+id,
          method: 'delete',
      })
    },
    selectAllVariety(id) {
      return service({
          url: '/CriteriaAPIStructure/selectAllLmeVariety',
          method: 'get',
      })
    },
    add(data) {
      return service({
          url: '/CriteriaAPIStructure/insertInstitutionLmeInventory',
          method: 'post',
          data
      })
    },
    edit(data) {
      return service({
          url: '/CriteriaAPIStructure/updateInstitutionLmeInventory',
          method: 'put',
          data
      })
    }
  }
  return fn;

}

// 持仓
export function LME_POSITIONApi() {
  const fn = {
    getPage(params) {
      return service({
          url: '/CriteriaAPIStructure/selectInstitutionLmePosition',
          method: 'get',
          params
      })
    },
    del(id) {
      return service({
          url: '/CriteriaAPIStructure/deleteLmePositionById/'+id,
          method: 'delete',
      })
    },
    // selectAllVariety(id) {
    //   return service({
    //       url: '/CriteriaAPIStructure/selectAllVariety',
    //       method: 'get',
    //   })
    // },
    add(data) {
      return service({
          url: '/CriteriaAPIStructure/insertInstitutionLmePosition',
          method: 'post',
          data
      })
    },
    edit(data) {
      return service({
          url: '/CriteriaAPIStructure/updateLmePosition',
          method: 'put',
          data
      })
    }
  }
  return fn;

}